package com.ptt.sqm.activity;

import com.ptt.sqmonmobile.R;
import com.ptt.sqmonmobile.R.layout;

import android.opengl.Visibility;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TableLayout;

public class CustomerFragment extends Fragment  {


	@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onViewCreated(view, savedInstanceState);
		final ImageView mCustBtn = (ImageView) view.findViewById(R.id.customer_showhide);
		mCustBtn.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				TableLayout mCustBox = (TableLayout) getView().findViewById(R.id.customer_box);
				
				if (mCustBox.getVisibility() == TableLayout.VISIBLE) {
					mCustBtn.setImageResource(R.drawable.showbox);
					mCustBox.setVisibility(TableLayout.GONE);
				} else {
					mCustBtn.setImageResource(R.drawable.hidebox);
					mCustBox.setVisibility(TableLayout.VISIBLE);
				}
			}
		});
	}
	
	@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View V = inflater.inflate(R.layout.fragment_customer, container, false);

        return V;
    }
}
